<?php

namespace app\admin\controller\mall;

use app\admin\traits\Curd;
use app\common\controller\AdminController;
use app\common\model\MallTags;
use EasyAdmin\annotation\ControllerAnnotation;
use EasyAdmin\annotation\NodeAnotation;
use think\App;
/**
 * @ControllerAnnotation(title="标签管理")
 */
class Tags extends AdminController
{
    use Curd;
    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->model =(new MallTags());
    }


    /**
     * @NodeAnotation(title="获取标签类型")
     */
    public function getCateByList()
    {
        $treeList = $this->model->order('id desc')->select()->toArray();
        $treeLists=array();
        foreach ($treeList as $k=>$v){
            $treeLists[$k]['value'] =$v['id'];
            $treeLists[$k]['name'] =$v['title'];
            $treeLists[$k]['selected'] =false;
            $treeLists[$k]['disabled'] =false;
        }

        $this->success('ok',$treeLists);
    }
}